'use strict';

angular.module('memoriesApp', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {

  $stateProvider

    // setup an abstract state for the tabs directive
    .state('tabs', {
      url: '/tabs',
      abstract: true,
      templateUrl: 'views/tabs.html'
    })

    .state('tabs.photo-list', {
      url: '/photos',
      views: {
        'photo-tab':  {
          templateUrl: 'views/photo-list.html',
          controller: 'PhotoListCtrl'
        }
      }
    })

    .state('tabs.photo-detail', {
      url: '/photo/:photoId',
      views: {
        'photo-tab':  {
          templateUrl: 'views/photo-detail.html',
          controller: 'PhotoDetailCtrl'
        }
      }
    })

    .state('tabs.settings', {
      url: '/settings',
      views: {
        'settings-tab': {
          templateUrl: 'views/settings.html',
          controller: 'SettingsCtrl'
        }
      }
    })

    .state('tabs.about', {
      url: '/about',
      views: {
        'about-tab': {
          templateUrl: 'views/about.html'
        }
      }
    });

  // if none of the above states are matched, use this as the fallback
  $urlRouterProvider.otherwise('tabs/photos');

});